package com.cool.modules.finance.dto.statistics;

import com.cool.modules.finance.entity.order.FinanceOrderEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ExpendRankVo {

    private String name;

    private BigDecimal amount;

    private String orderDate;

    private String coinSymbol;

    public ExpendRankVo(FinanceOrderEntity order) {
        this.name = order.getOrderDetail();
        this.amount = order.getOrderMoney();
        this.orderDate = new SimpleDateFormat("yyyy-MM-dd").format(order.getOrderDate());
        this.coinSymbol = order.getCoinSymbol();
    }

}
